package serviceimpl;

import dao.DetailDAO;
import model.Detail;
import service.DetailService;

import java.util.List;

/**
 * Created by admin on 2016/8/15.
 */

public class DetailServiceImpl implements DetailService{
    private DetailDAO detailDAO;
    public void save(Detail detail) {
        detailDAO.save(detail);
    }

    public List findAll() {
        return detailDAO.findAll();
    }

    public Detail findById(int id) {
        return detailDAO.findById(id);
    }

    @Override
    public void delete(Detail detail) {
        detailDAO.delete(detail);
    }

    @Override
    public void update(Detail detail) {
        detailDAO.update(detail);
    }

    @Override
    public List findByOrder(int orederId) {
        return detailDAO.findByOrder(orederId);
    }

    public void setDetailDAO(DetailDAO detailDAO) {
        this.detailDAO = detailDAO;
    }
}
